<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // //1
        // var regexp = new RegExp(/123/);
        // console.log(regexp);
        // //2
        // var rg = /123/;
        // //3 test
        // console.log(rg.test(123));
        //----------------边界符--------------------------
        var rg = /abc/;
        console.log(rg.test('abc'));
        console.log(rg.test('babc'));
        console.log(rg.test('abcb'));
        var rag = /^abc/;
        console.log(rag.test('abcd'));
        console.log(rag.test('aabc'));
        console.log(rag.test('abc'));
        var rrg = /^abc$/;
        console.log(rrg.test('abc'));
        console.log(rrg.test('aabc'));
    </script>
</body>
</html>